<%--
  Created by IntelliJ IDEA.
  User: 76053
  Date: 2020/5/19
  Time: 11:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录成功页面</title>
</head>
<body>
<script type="text/javascript" src="../js/jquery-3.4.1.min(1).js"></script>

${student.s_name}
<div id="solr">
    <ul>
        <li><a href=""></a></li>

    </ul>

</div>


<script type="text/javascript">
        $.ajax({
            url:"/solr",
            data:"name=${student.s_name}",
            dataType:"json",
            success:function (data) {
                /!*数据渲染添加上去*!/
                var html="";
                for(var i=0;i<data.length;i++){
                    html+="<li class=\"caidan"+(i+1)+"\">"
                    html+=" <a>"+data[i].s_name+"</a>"
                    html+="<ul class=\"second-ul second-ul-right xiala"+(i+1)+"\" style=\"display: none\">"
                    for(var n=0;n<data[i].twosolr.length;n++){
                        html+=" <li>"
                        html+="<a href=\"\" target=\"iframeMain\" onclick=\"return openUrl(this)\">"+data[i].twosolr[n].t_name+"</a>"
                        html+=" </li>"
                    }
                    html+="</ul>";
                }
                html+="</li>"
                $("#main-nav .top-nav").html($(html))

                $(".caidan1").hover(
                    function () {
                        $(".xiala1").show();
                    },
                    function () {
                        $(".xiala1").hide();
                    });
                $(".caidan2").hover(
                    function () {
                        $(".xiala2").show();
                    },
                    function () {
                        $(".xiala2").hide();
                    });
                $(".caidan3").hover(
                    function () {
                        $(".xiala3").show();
                    },
                    function () {
                        $(".xiala3").hide();
                    });
                $(".caidan4").hover(
                    function () {
                        $(".xiala4").show();
                    },
                    function () {
                        $(".xiala4").hide();
                    });
            }
        })


</script>

</body>
</html>
